<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in</name>
<id>-1</id>
<cardCount>11</cardCount>
<cardID>7241</cardID>
<listID>8066</listID>
<cantModify><false /></cantModify>
<cantDelete><false /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>512</width>
<height>342</height>
</cardSize>
<script>-- Script Manager 1.0-- © 1989 Peter Jörgensen, Hamilton, NY-- AutoDoc 1.0 scripts-- © 1989 Peter Jörgensen, Hamilton, NYon getHomeInfo -- Merge with or replace original script!global stacks,applications,documents,userNameglobal override,autocomp,compLimit -- new globalsset lockScreen to trueset lockMessages to truepush this cdgo to cd "User Preferences" of stack "Home"put cd fld "User Name" into userNameset userLevel to cd fld "User Level"set powerKeys to the hilite of btn "Power Keys"set blindTyping to the hilite of btn "Blind Typing"put the hilite of btn "autocomp" into autocomp -- newput the hilite of btn "No Autodoc" into override -- newput cd fld "Compaction Limit" into compLimit -- newput fld "paths" of cd "stacks" into stacksput fld "paths" of cd "applications" into applicationsput fld "paths" of cd "documents" into documentspop cdend getHomeInfoon openStack -- Merge with or replace original handler!if the short name of this stack is "Script Manager" then show cd fld "copyright" of cd 1global autodoc,curstackput checkauto() into autodocput the long name of this stack into curStackgetScript "stack"pass OpenStackend openStackon CloseStack -- Merge with or replace original handler!checkScript "stack"global complimit,autocompif autocomp is "true" thenif the Freesize of this stack > complimit * 1000 thenAnswer "Compact stack?" with "No" or "Yes"if it is "Yes" then doMenu "Compact Stack"end ifend ifPass CloseStackend CloseStackon openBackground -- Merge with or replace original handler!global curBgput the long name of this background into CurBggetScript "bg"pass openBackgroundend openBackgroundon CloseBackground -- Merge with or replace original handler!checkScript "bg"pass CloseBackgroundend CloseBackgroundon openCard -- Merge with or replace original handler!global curCdput the long name of this card into CurCdgetScript "card"pass OpenCardend openCardon CloseCard -- Merge with or replace original handler!idlecheckScript "card"Pass CloseCardend CloseCardon deletefieldstoppass deletefieldend deletefieldon deletebuttonstoppass deletebuttonend deletebuttonon checkScript anObject-- (c) 1988 Peter Jörgensen - Hamilton, NYglobal stackScript,bgScript,CardScript,autodoc,theObjectif autodoc is empty then put false into autodocif autodoc thenif anObject = "stack" thenget the script of this stackif it is not StackScript thendocumentChanges "Stack",""end ifput false into autodocelse if anObject = "bg" thenget the script of this bgif it is not bgScript thendocumentChanges "bg",trun (the long name of this bg)end ifelse if anObject = "card" thenput empty into theObjectget the script of this cdif it is not cardScript thendocumentChanges "card",trun (the long name of this card)end ifend ifend ifend checkScripton stopglobal theObjectput empty into theObjectend stopon newStackAnswer "Install autodoc in this stack?" with "No" or "Yes"if it is "No" then exit newStackcheckAndAdd -- cd fld "modifications"end newStackon NewVersionglobal AutoDoc,theObject,overrideput empty into theObjectput override into curoverrideput false into overrideput empty into autodocif autodoc is empty then put checkauto() into autodocif AutoDoc thenpush this cardset the lockmessages to trueAnswer "OK to clear modification record?" with "NO!" or "OK"¬or "Save A Copy"if it is "NO!" then exit NewVersionif it is "Save A Copy" then doMenu "Save a copy..."get line 1 of cd fld "modifications" of cd 1if char 1 of it is not "V" then put 0 into versionelse put word 2 of it into versionAsk "Present version is: "&version&"; change to:" with version+.1if it is empty then exit NewVersionput "Version"&& it && "of"&& the name of this stack &&¬"as of " & the date & " at " & the time&¬return into cd fld "modifications" of cd 1set the script of this stack to clearmods(the script of this stack)lock screenrepeat with b = 1 to the number of bgsset the cursor to watchgo cd 1 of bg bset the script of this bg to clearmods(the script of this bg)repeat with bb = 1 to the number of bg btnsset the script of bg btn bb to clearmods(the script of bg btn bb)end repeatrepeat with f = 1 to the number of fldsset the script of fld f to clearmods(the script of fld f)end repeatend repeatrepeat with c = 1 to the number of cdsset the cursor to plusgo cd cset the script of this cd to clearmods(the script of this cd)repeat with b = 1 to the number of btnsset the script of btn b to clearmods(the script of btn b)end repeatrepeat with cf = 1 to the number of cd fldsset the script of cd fld cf to clearmods(the script of cd fld cf)end repeatend repeatend ifpop cardgetscript "stack"getscript "bg"getscript "card"put curoverride into override-- © 1988 Peter Jorgensen-- Script for clearing modification documentation from scripts of-- all objects in a stack and incrementing version number on-- card field "Modifications" of card 1 of stack and clearing-- modification records from same field.end NewVersionfunction clearMods aScriptput "Modified " & "on" into theKeyif aScript contains theKey thenrepeat with ln = (the number of lines in aScript) down to 1set the cursor to busyif line ln of aScript contains theKey thendelete line ln of aScriptend ifend repeatend ifreturn aScriptend clearModsfunction extractHandler hdlNo,aScript--Modified by Peter Jörgensen on Tuesday, November 14, 1989 at 11:16:38 AMglobal EndofPrevif hdlNo = 1 then put 1 into EndOfPrevrepeat with ScriptLine = EndOfPrev to the number of lines in aScriptset the cursor to busyif word 1 of line scriptLine of aScript is in "on,function" thenput word 2 of line ScriptLine of aScript into theMessageput line ScriptLine of aScript into HdlrScriptrepeat with hdlrLine = ScriptLine+1 to the number of lines in aScriptset the cursor to busyput return&line hdlrLine of aScript after HdlrScriptif (line hdlrLine of aScript contains "send") then next repeatif (line hdlrLine of aScript contains "end")¬and (line hdlrLine of aScript contains theMessage) thenput hdlrLine into EndOfPrevreturn HdlrScriptend ifend repeatend ifend repeatreturn "No more Handlers"end extractHandleron documentChanges anObject,ObjectNameglobal newscript,oldScript,theScript,StackScript,CardScript,¬BgScript,usernameAnswer "Documenting " &anObject with "Cancel" or"OK" or "Save Copy"if it is "Cancel" then exit documentChangesif it is "Save Copy" then doMenu "Save a Copy..."put the script of anObject into newScriptif (anObject contains "button") or (anObject contains "field") thenput theScript into oldScriptelse if anObject contains "stack" thenput StackScript into oldScriptelse if anObject contains "bkgnd" thenput bgScript into oldScriptelse put CardScript into oldScriptput 1 into hndlerNorepeatset the cursor to busy-- compare the handlers, and document the changed ones.put extractHandler(hndlerNo,newScript) into aHandlerif aHandler = "No more Handlers" then exit repeatif not (oldScript contains aHandler) thenput return & "-" & "-" & "Modified by " & username && "on " & the long date &¬" at " & the long time after line 1 of aHandlerend ifput aHandler & return & return after documentedScriptadd 1 to hndlerNoend repeatput "-" & "-" & "Modified " & "on " & the long date &¬"-" & the long time & return before documentedScriptset the script of anObject to documentedScriptput ObjectName &" modified by "& username&& "on " & the long date &&¬"at" && the time & return after cd fld "Modifications" of cd 1end documentChangeson getScript anObjectglobal stackScript,bgScript,CardScript,autodoc,CurStack,CurBg,CurCdlock screenset the lockmessages to trueif autodoc is empty then put false into autodocif AutoDoc thenif anObject is "stack" thenput the script of this stack into stackScriptelse if anObject is "bg" thenput the script of this bg into bgScriptelse if anObject is "card" thenput the script of this cd into CardScriptend ifend ifset the lockscreen to falseset the lockmessages to falseend getScripton idleglobal theObject,theScript,AutoDoc,CurStack,CurBg,CurCdif the long name of this stack is not CurStack thenput the long name of this stack into CurStackput checkauto() into autodocgetScript "stack"end ifif the long name of this background is not CurBg thenput the long name of this background into CurBggetScript "bg"end ifif the long name of this cd is not CurCd thenstopput the long name of this card into CurCdgetscript "card"end ifif AutoDoc thenif theObject is not empty thenif the mouseloc is not within the rect of theObject thenif the script of theObject is not theScript thendocumentchanges theObject,trun(the long name of theObject)end ifput empty into theObjectput empty into theScriptend ifend ifend ifpass idleend idlefunction checkAutoglobal overrideif override is empty then put false into overrideif (the userlevel is 5) and (not override) thenset the lockmessages to trueset the lockscreen to truepush cdgo cd 1repeat with f = 1 to the number of cd fldsif the short name of cd fld f is "modifications" thenpop cdreturn trueend ifend repeatpop cdend ifreturn falseend checkAutofunction trun aNameput offset("of stack",aName) into theTaildelete char (theTail-1) to (the number of chars in aName) of aNamereturn aNameend trunon modsglobal FldSettingsif FldSettings is empty thenpush cardgo cd 1put the rect of cd fld "Modifications" into line 1 of FldSettingsput the style of cd fld "Modifications" into line 2 of FldSettingsput the visible of cd fld "Modifications" into line 3 of FldSettingsput the textfont of cd fld "Modifications" into line 4 of FldSettingsput the textsize of cd fld "Modifications" into line 5 of FldSettingsput the textstyle of cd fld "Modifications" into line 6 of FldSettingsput the textalign of cd fld "Modifications" into line 7 of FldSettingsset the rect of cd fld "Modifications" of cd 1 to 8,24,502,331set the style of cd fld "Modifications" to "Scrolling"show cd fld "Modifications" of cd 1set the textfont of cd fld "Modifications" to "Monaco"set the textsize of cd fld "Modifications" to 12set the textstyle of cd fld "Modifications" to "plain"set the textalign of cd fld "Modifications" to "left"elseset the rect of cd fld "Modifications" to line 1 of FldSettingsset the style of cd fld "Modifications" to line 2 of FldSettingsset the visible of cd fld "Modifications" to line 3 of FldSettingsset the textfont of cd fld "Modifications" to line 4 of FldSettingsset the textsize of cd fld "Modifications" to line 5 of FldSettingsset the textstyle of cd fld "Modifications" to line 6 of FldSettingsset the textalign of cd fld "Modifications" to line 7 of FldSettingsput empty into FldSettingspop cardend ifend modson mouseEnter-- automatic script getter for buttons and flds-- (c) 1988 Peter Jörgensen - Hamilton, NYglobal theObject,theScript,AutoDoc,peekingif autodoc is empty then put false into autodocif autoDoc thenif the name of the target contains "bkgnd button" thenput "bg button id " into theObjectelse if the name of the target contains "button" thenput "button id " into theObjectelse if the name of the target contains "card field" thenput "card field id " into theObjectelse if the name of the target contains "field" thenput "field id " into theObjectend ifput the id of the target after theObjectif peeking is "true" thenput theObjectend ifput the script of theObject into theScriptend ifpass mouseEnterend mouseEnteron checkAndAdd -- adds cd fld "modifications" to cd 1 of a stack, if-- it isn't already there.-- (c) 1988 Peter Jörgensen - Hamilton, NYif the cantmodify of this stack is true thenAnswer "This stack cannot be modified." with "OK"exit checkAndAddend ifrepeat with f = 1 to the number of cd fldsif the short name of cd fld f is anObject thenAnswer ObjectKind&"e& anObject"e&&"already exists"¬with "OK"exit checkAndAddend ifend repeatput the number of cd flds into lastFieldput lastField + 1 into myFielddoMenu "New Field"set the name of cd fld myfield to "modifications"set the rect of cd fld myfield to 8,24,502,331set the style of cd fld myfield to "Scrolling"set the textfont of cd fld myfield to "Monaco"hide cd fld "Modifications"Answer "Auto Doc fld has been added."choose browse toolend checkAndAddfunction extractFname aPathName-- version 1.0 © 1989 Peter Jörgensen, Hamiton, NY-- this handler returns a file's name given it's full pathname-- © 1989 Peter Jörgensenrepeatget offset(":",aPathName)if it is 0 then return aPathNamedelete char 1 to it of aPathNameend repeatend extractFname</script>